Topic: List of online avatars at top of forum
I had this working using the below code in version 1.2
Does anyone know what I can do to make it work in 1.3?
I don't want to just paste it in in case I mess everything up
What do you think, will the below code work?
<!-- LIST OF ONLINE AVATARS -->
<?php
if ($pun_config['o_users_online'] == '1')
{
// Fetch users online info and generate strings for output
$num_guests = 0;
$users = array();
$result = $db->query('SELECT user_id, ident FROM '.$db->prefix.'online WHERE idle=0 ORDER BY ident', true) or error('Unable to fetch online list', __FILE__, __LINE__, $db->error());
while ($pun_user_online = $db->fetch_assoc($result))
{
if ($pun_user_online['user_id'] > 1)
{
if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$pun_user_online['user_id'].'.gif'))
$users[] = "\n\t\t\t\t".'<dd><a title="'.pun_htmlspecialchars($pun_user_online['ident']).'" href="profile.php?id='.$pun_user_online['user_id'].'"><img src="'.$pun_config['o_avatars_dir'].'/'.$pun_user_online['user_id'].'.gif" '.$img_size[3].' alt="" /></a>';
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$pun_user_online['user_id'].'.jpg'))
$users[] = "\n\t\t\t\t".'<dd><a title="'.pun_htmlspecialchars($pun_user_online['ident']).'" href="profile.php?id='.$pun_user_online['user_id'].'"><img src="'.$pun_config['o_avatars_dir'].'/'.$pun_user_online['user_id'].'.jpg" '.$img_size[3].' alt="" /></a>';
else if ($img_size = @getimagesize($pun_config['o_avatars_dir'].'/'.$pun_user_online['user_id'].'.png'))
$users[] = "\n\t\t\t\t".'<dd><a title="'.pun_htmlspecialchars($pun_user_online['ident']).'" href="profile.php?id='.$pun_user_online['user_id'].'"><img src="'.$pun_config['o_avatars_dir'].'/'.$pun_user_online['user_id'].'.png" '.$img_size[3].' alt="" /></a>';
else
$users[] = "\n\t\t\t\t".'<dd><a href="profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>';
}
else
++$num_guests;
}
$num_users = count($users);
/*echo "\t\t\t\t".'<dd>'. $lang_index['Users online'].': <strong>'.$num_users.'</strong></dd>'."\n\t\t\t\t".'<dd>'.$lang_index['Guests online'].': <strong>'.$num_guests.'</strong></dd>'."\n\t\t\t".'</dl>'."\n";*/
if ($num_users > 0)
echo "\t\t\t".'<dl id="onlinelist" class= "clearb"><!--<a href="/"><img src="/img/avatar-logo.jpg" alt="royton"></a>-->'."\n\t\t\t\t".'<dt><strong>'.$lang_index['Online'].'</strong></dt>'."\t\t\t\t".implode('</dd> ', $users).'
</dd>'."\n\t\t\t".'</dl>'."\n";
else
echo "\t\t\t".'<div class="clearer"></div>'."\n";
}
else
echo "\t\t".'</dl>'."\n\t\t\t".'<div class="clearer"></div>'."\n";
?>
<!--END OF ONLINE AVATARS -->